package com.aabte.mybatis.mapper;

import com.aabte.mybatis.bean.Employee;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface EmployeeMapper {

    Employee findEmployeeById(int id);

    Map<String, Object> findEmployeeByIdReturnMap(int id);

    List<Employee> findEmployeeByLastNameAndGender(@Param("lastName") String lastName, @Param("gender") String gender);

    /**
     * 返回Id作为Key的map集合
     */
    @MapKey("id")
    Map<Integer, Employee> findEmployeeByLastNameAndGenderReturnMap(@Param("lastName") String lastName, @Param("gender") String gender);

    List<Employee> findEmployeeByMap(Map<String, Object> paramsMap);

    List<Employee> findEmployeeByDeptId(int deptId);

    long addEmployee(Employee employee);

    long updateEmployee(Employee employee);

    long deleteEmployeeById(int id);

}
